// run: $exec < input
#include <iostream>
#include <algorithm>
#include <cmath>

double const sqrt2 = std::sqrt(2);
long long n;

int main()
{
	std::ios::sync_with_stdio(false);
	std::cin >> n;
	if (!n) { std::cout << "1\n"; return 0; }
	double x = n / sqrt2;
	long long tx = x;
	long long t = tx * 2;
	if (tx * tx + (tx + 1) * (tx + 1) > n * n) t--;
	std::cout << 4 * t + 4 << '\n';
}

